package framework.webmvc.component;

import java.util.Map;

/**
 * class that store the correspond relationship between view and model
 */
public class InchModelAndView {
    private String viewName;
    private Map<String,?> model;

    /**
     * Constructor with only view name the model will set to null
     * @param viewName name of the view
     */
    public InchModelAndView(String viewName) {
        this(viewName,null);
    }

    /**
     * Constructor with view name and the model
     * @param viewName name of the view
     * @param model the model which the view match with
     */
    public InchModelAndView(String viewName,Map<String,?> model) {
        this.viewName = viewName;
        this.model = model;
    }

    public String getViewName() {
        return viewName;
    }

    public void setViewName(String viewName) {
        this.viewName = viewName;
    }

    public Map<String, ?> getModel() {
        return model;
    }

    public void setModel(Map<String, ?> model) {
        this.model = model;
    }
}
